{% extends "base.html" %}
{% load thumbnail %}

{% block title %}Welcome{% endblock %}

{% block content %}
<h2>Welcome to MediaNav</h2>
<h3>Latest movies</h3>
<table>
    <tr>
        <th></th>
        <th align=left>Title</th>
        <th align=left>Genre</th>
        <th align=left>Added</th>
    </tr>
{% for dir in movies %}
    <tr class="{% cycle 'odd' 'even' %}">
        <td><img src="{% thumbnail dir.movie.poster_filename 48x70 %}"></td> 
        <td><a href="{% url movies.views.movie_detail movie_id=dir.movie.id %}">{{ dir.format_name }}</a></td>
        <td>
        {% for genre in dir.movie.genres.all %}
        {{ genre.short_name }}
        {% endfor %}
        </td>
        <td>{{ dir.date_added }}</td>
    </tr>
{% endfor %}
</table>
{% endblock %}
